Beginning Programming FOR Dummies 3RD EDITION by Wallace Wang
Author:Wallace Wang [Wang, Wallace]
Language: eng
Format: epub
Tags: Team DDU
Published: 0101-01-01T00:00:00+00:00
19 549979 Ch14.qxd 11/4/03 12:19 PM Page 198
198 Part III: Advanced Programming with Liberty BASIC
Each time that you create additional menu commands, you need to create instructions (which a [label] identifies) for the computer to follow whenever the user chooses those commands.
Figure 14-2:
Liberty
BASIC
can create
pull-down
menus.
Making Pop-Up Menus
In addition to pull-down menus, many programs also offer pop-up menus that appear next to the mouse pointer when you right-click the mouse. To create a pop-up menu in Liberty BASIC, you need to use the POPUPMENU command, as follows:
POPUPMENU “command1”, [label1], “command2”, [label2]
To make the POPUPMENU easier to understand, place each command and label on a separate line and use the underscore character (_) at the end of each line.
The underscore character tells Liberty BASIC that additional instructions appear on the following line. You can use the underscore character to divide long lines of commands into shorter, separate lines, such as you see in the following example:
POPUPMENU _
“command1”, [label1], _
“command2”, [label2], _
“command3”, [label3]
19 549979 Ch14.qxd 11/4/03 12:19 PM Page 199
Chapter 14: Creating a User Interface
199
Here’s what the preceding commands do:
1. The POPUPMENU command tells the computer, “Create a pop-up menu next to the current position of the mouse pointer.”
2. The “command1” and “command2“ text are the actual commands that appear on the pop-up menu. You can add additional commands so that your pop-up menus can display 5, 7, or 15 different commands.
3. The [label1] and [label2] labels identify instructions for the computer to follow if the user chooses a particular menu command. So if the user chose “command1”, the computer immediately follows the instructions that the [label1] label identifies.
If you want to add a horizontal line to separate commands on your pop-up menu, just use the vertical line character (|) in place of a command and omit any label following the | character, as shown in the example below.
POPUPMENU _
“command1”, [label1], _
|, _
“command3”, [label3]
To see how pop-up menus work, try the following program, as shown in Figure 14-3. Notice how the vertical line character creates a horizontal line to separate commands on the pop-up menu.
NOMAINWIN
POPUPMENU _
“Destroy the planet”, [one], _
“Poison the environment”, [two], _
| ,_
“Get elected to political office”, [three]
NOTICE “Nothing selected.”
END
[one]
NOTICE “Launching missiles now.”
END
[two]
NOTICE “Spilling oil into the oceans.”
END
[three]
NOTICE “Fooled the public once more.”
END
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
What's Done in Darkness by Kayla Perrin(26607)
The Fifty Shades Trilogy & Grey by E L James(19089)
Shot Through the Heart: DI Grace Fisher 2 by Isabelle Grey(19073)
Shot Through the Heart by Mercy Celeste(18946)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 10 by Isuna Hasekura and Jyuu Ayakura(17125)
Python GUI Applications using PyQt5 : The hands-on guide to build apps with Python by Verdugo Leire(17008)
Peren F. Statistics for Business and Economics...Essential Formulas 3ed 2025 by Unknown(16886)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 03 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16835)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 01 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16459)
The Subtle Art of Not Giving a F*ck by Mark Manson(14368)
The 3rd Cycle of the Betrayed Series Collection: Extremely Controversial Historical Thrillers (Betrayed Series Boxed set) by McCray Carolyn(14151)
Stepbrother Stories 2 - 21 Taboo Story Collection (Brother Sister Stepbrother Stepsister Taboo Pseudo Incest Family Virgin Creampie Pregnant Forced Pregnancy Breeding) by Roxi Harding(13660)
Scorched Earth by Nick Kyme(12779)
Drei Generationen auf dem Jakobsweg by Stein Pia(10973)
Suna by Ziefle Pia(10896)
Scythe by Neal Shusterman(10355)
The Ultimate Python Exercise Book: 700 Practical Exercises for Beginners with Quiz Questions by Copy(10040)
De Souza H. Master the Age of Artificial Intelligences. The Basic Guide...2024 by Unknown(10005)
D:\Jan\FTP\HOL\Work\Alien Breed - Tower Assault CD32 Alien Breed II - The Horror Continues Manual 1.jpg by PDFCreator(9999)
